package com.cby.jetpack.sample.paging3.adapter

import android.view.ViewGroup
import androidx.paging.LoadState
import androidx.paging.LoadStateAdapter
import com.cby.jetpack.sample.paging3.holder.LoadStateViewHolder

/**
 * @description: LoadStateFooterAdapter
 *
 * @author ChenBaoyang
 * @date 2021/8/13 13:37
 */
class LoadStateFooterAdapter(private val retry:()->Unit) :
    LoadStateAdapter<LoadStateViewHolder>() {

    override fun onBindViewHolder(holder: LoadStateViewHolder, loadState: LoadState) {
        holder.bindState(loadState)
    }

    override fun onCreateViewHolder(parent: ViewGroup, loadState: LoadState): LoadStateViewHolder {
        return LoadStateViewHolder(parent, retry)
    }
}